package com.lcx.movie.controller;

import com.lcx.movie.entity.Actor;
import com.lcx.movie.service.ActorService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李丽君
 * @version 1.0
 * @Description
 * @date 2025/3/12 10:22
 */
@RestController
@CrossOrigin(origins = "*")
public class ActorController {
    @Autowired
    private ActorService actorService;
    /**
     * 新增演员信息
     * @param actor 演员对象
     * @return 受影响的行数
     */
    @PostMapping("/insertActor")
    public String insertActor(@RequestBody Actor actor){
        int insertActor = actorService.insertActor(actor);
        if (insertActor > 0){
            return "新增演员成功";
        }else {
            return "新增演员失败";
        }
    }
}
